﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Office.Project.Server.Library;

namespace FluentPS.Mapping
{
    public static class PSDataTypesHelper
    {
        internal static PSDataType GetFieldType(Type type)
        {
            if (type.Equals(typeof(Guid)))
                return PSDataType.GUID;
            if (type.Equals(typeof(decimal)))
                return PSDataType.NUMBER;
            if (type.Equals(typeof(int)))
                return PSDataType.NUMBER;
            if (type.Equals(typeof(DateTime)))
                return PSDataType.DATE;
            if (type.Equals(typeof(bool)))
                return PSDataType.YESNO;
            if (type.Equals(typeof(double)))
                return PSDataType.NUMBER;

            return PSDataType.STRING;
        }
    }
}
